import { Route, NavLink, Switch } from "react-router-dom"
import Home from "./components/Home"
import Detail from "./components/Detail"
import { Redirect } from "react-router-dom"
export default function App() {
  return (
    <div>
      <NavLink to={"/home"} activeClassName="linkActived">home</NavLink>
      <br />
      <NavLink to={"/detail"} activeClassName="linkActived">detail</NavLink>
      <hr />
      <Switch>
        <Route path="/" component={Home} exact></Route>
        <Route path="/home" component={Home}></Route>
        <Route path="/detail" component={Detail}></Route>
        <Redirect from="/home" to="/detail"></Redirect>
      </Switch>
      <hr />
    </div>
  )
}
